function launchServiceListFromCWD() {
	changeDirAndRedirect("services",null);
}
function launchServiceFromCWD(serviceFName) {
    changeDirAndRedirect("launcher",serviceFName);
}
function launchTerminalFromCWD() {
    changeDirAndRedirect("terminal",null);
}

function changeDirAndRedirect(kind, service) {
    var launchUrl = ElementsEntryPointInitParams['SAVE_REDIRECT_URL'];
    var cwd = FileManager['filemanager'].getCurrentDirectoryString();
    var ef_rfb = FileManager['filemanager'].getSelectedFilesAsString();

    if (service !=null) launchUrl += '&service=' + service;
    if (kind != null)   launchUrl += '&kind=' + kind;
    if (cwd != null)    launchUrl += '&dir=' + encodeURIComponent(cwd);
    if (ef_rfb != null)    launchUrl += '&ef_rfb=' + encodeURIComponent(ef_rfb);

    window.location.replace(launchUrl);
}

